package br.org.isvi.mgadmin.validators;

import org.eclipse.core.databinding.validation.IValidator;
import org.eclipse.core.databinding.validation.ValidationStatus;
import org.eclipse.core.runtime.IStatus;

public class TypeValidator implements IValidator {
	
	public TypeValidator(){}

	@Override
	public IStatus validate(Object arg0) {
		
		try {
			Integer.parseInt(arg0.toString());
		} catch (NumberFormatException e) {
			return ValidationStatus.error("Type mismatch");
		}
		
		return ValidationStatus.ok();
	}
	
}
